﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

namespace UI
{
    public class RushSweepToTopConfirmPanel : MonoBehaviour
    {
        public UILabel detailLabel;
        public List<UITweener> tweeners;

        public RushPage rushPage;

        public void Enter(int maxFloor)
        {
            Show();
            detailLabel.text = string.Format(TableTextBlo.GetText("rush_sweep_to_top_detail"), maxFloor);

            foreach (var tweener in tweeners)
            {
                if (tweener != null)
                {
                    tweener.ResetToBeginning();
                    tweener.PlayForward();
                }
            }
        }

        public void Exit()
        {
            Hide();
        }

        public void OnConfirmButtonClick()
        {
            Exit();
            PageManager.Instance.OpenPage("RushSweepPage", "type=1");

        }
        public void OnCancelButtonClick()
        {
            Exit();
        }

        public void Show()
        {
            gameObject.SetActive(true);
        }
        public void Hide()
        {
            gameObject.SetActive(false);
        }
    }

}